import { createApp} from 'vue'
import '@/assets/css/global.css'
import pinia from './stores'
import App from './App.vue'
import router from './router'
// 引入 Elmessage 样式
import 'element-plus/theme-chalk/src/message.scss'
// 引入 eCharts 
// import * as echarts from 'echarts'
// 引入动态组件
import * as Icons from "@element-plus/icons-vue";

const app = createApp(App)

app.use(pinia)
app.use(router)

// app.config.globalProperties.$echarts = echarts  // 全局挂载echarts

app.mount('#app')

// 全局注册
Object.keys(Icons).forEach((key) => {
    app.component(key, Icons[key]);
});

// Icon自定组件
// const Icon = (props) => {
//     defineOptions({
//         name:'IconCom'
//     })
//     const { icon } = props;
//     return createVNode(Icons[icon]);
// };
// app.component("IconCom", Icon);

